package com.eos.orm.mybatis.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.eos.orm.mybatis.dao.CustGuaranteeMonthReportMapper;
import com.eos.orm.mybatis.model.CustGuaranteeMonthReport;
import com.eos.orm.mybatis.model.CustGuaranteeMonthReportExample;

/**
 * cust_guarantee_month_report表的CURD操作
 * 
 * @author sz
 * 
 */
public class CustGuaranteeMonthReportMapperImpl extends
		AbstractSqlSessionFactory implements CustGuaranteeMonthReportMapper {

	public int countByExample(CustGuaranteeMonthReportExample example) {
		return 0;
	}

	public int deleteByExample(CustGuaranteeMonthReportExample example) {
		return 0;
	}

	public int deleteByPrimaryKey(Integer id) {
		return 0;
	}

	public int insert(CustGuaranteeMonthReport record) {
		SqlSession session = sqlSessionFactory.openSession();
		try {
			CustGuaranteeMonthReportMapper mapper = session
					.getMapper(CustGuaranteeMonthReportMapper.class);
			mapper.insert(record);
			session.commit();
			mapper = null;
		} catch (Exception e) {
			System.out
			.println("com.eos.orm.mybatis.dao.impl.CustGuaranteeMonthReportMapperImpl.insert throws exception:"
					+ e.getMessage());
			return -1;
		} finally {
			session.close();
		}
		return 0;
	}

	public int insertSelective(CustGuaranteeMonthReport record) {
		return 0;
	}

	public List<CustGuaranteeMonthReport> selectByExample(
			CustGuaranteeMonthReportExample example) {
		List<CustGuaranteeMonthReport> templist = new ArrayList<CustGuaranteeMonthReport>();
		SqlSession session = sqlSessionFactory.openSession();
		try {
			CustGuaranteeMonthReportMapper mapper = session
					.getMapper(CustGuaranteeMonthReportMapper.class);
			templist = mapper.selectByExample(example);
			mapper = null;
		} catch (Exception e) {
			System.out
			.println("com.eos.orm.mybatis.dao.impl.CustGuaranteeMonthReportMapperImpl.selectByExample throws exception:"
					+ e.getMessage());
		} finally {
			session.close();
		}
		return templist;
	}

	public CustGuaranteeMonthReport selectByPrimaryKey(Integer id) {
		return null;
	}

	public int updateByExample(CustGuaranteeMonthReport record,
			CustGuaranteeMonthReportExample example) {
		return 0;
	}

	public int updateByExampleSelective(CustGuaranteeMonthReport record,
			CustGuaranteeMonthReportExample example) {
		SqlSession session = sqlSessionFactory.openSession();
		try {
			CustGuaranteeMonthReportMapper mapper = session
					.getMapper(CustGuaranteeMonthReportMapper.class);
			mapper.updateByExampleSelective(record,example);
			session.commit();
			mapper = null;
		} catch (Exception e) {
			System.out
			.println("com.eos.orm.mybatis.dao.impl.CustGuaranteeMonthReportMapperImpl.updateByExampleSelective throws exception:"
					+ e.getMessage());
			return -1;
		} finally {
			session.close();
		}
		return 0;
	}

	public int updateByPrimaryKey(CustGuaranteeMonthReport record) {
		return 0;
	}

	public int updateByPrimaryKeySelective(CustGuaranteeMonthReport record) {
		SqlSession session = sqlSessionFactory.openSession();
		try {
			CustGuaranteeMonthReportMapper mapper = session
					.getMapper(CustGuaranteeMonthReportMapper.class);
			mapper.updateByPrimaryKeySelective(record);
			session.commit();
			mapper = null;
		} catch (Exception e) {
			System.out
			.println("com.eos.orm.mybatis.dao.impl.CustGuaranteeMonthReportMapperImpl.updateByPrimaryKeySelective throws exception:"
					+ e.getMessage());
			return -1;
		} finally {
			session.close();
		}
		return 0;
	}

}
